package com.jiugang.cardump.bean;

import com.jiugang.cardump.util.ReadPropertiesUtil;
import lombok.Data;
import java.text.MessageFormat;
import java.util.Properties;

/**
 * @Author tianchunlei
 * @Des //封装消息的bean
 * @Date 2021/8/5
 **/

@Data
public class InformationBean {

    //获取程序当前路径下的文件
    public static final Properties properties = ReadPropertiesUtil
            .getProperties("/information.properties");

     private String code;
     private String message;

    private InformationBean(String code, String... msg){
        this.code = code;
        this.message = MessageFormat.format(properties.getProperty(code),msg);
    }

    private InformationBean(){

     }

     public static InformationBean setInformationBean(String code,String...msg){
          return  new InformationBean(code,msg);
     }
}
